﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DnPakExplorer.Controls {
	public partial class TextControl : UserControl {

		private StringFormat mStringFormat;

		[Category("内容")]
		public string Content {
			get;
			set;
		}

		public int ClipText() {
			string text = Content;
			if (!String.IsNullOrEmpty(text)) {
				if(AutoSize){

				}
				Graphics g = CreateGraphics();
				//g.MeasureString()
			}
			return 0;
		}

		public TextControl() {
			InitializeComponent();
			mStringFormat = new StringFormat();
			mStringFormat.FormatFlags = StringFormatFlags.NoFontFallback;
		}

		private void TextControl_Paint(object sender, PaintEventArgs e) {
			e.Graphics.FillRectangle(Brushes.LightGray, ClientRectangle);
			e.Graphics.DrawString(Content, Font, new SolidBrush(ForeColor), ClientRectangle, mStringFormat);
		}
	}
}
